<template>
<el-row>
  <el-col :span="5" class="title">后台管理系统</el-col>
  <el-col :span="4" :offset="15">
    <el-button type="danger" @click="logout">安全退出</el-button>
  </el-col>
</el-row>

</template>

<script>
  export default {
    data () {
      return {}
    },
    methods: {
      logout () {
        this.$confirm('您确定要退出该平台吗, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$api.logout().then(res => {
            if (res.code === '000000') {
              this.$message.success('退出成功')
              this.$router.push('/login')
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
      }
    }

  }
</script>

<style lang="less" scoped>
.el-row{
  height:70px;
  background-color: #242f42;
  color: white;
  line-height:70px;
}
  .title{
    font-size: 22px;
  }
</style>
